<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>定位的特殊应用02_块元素定位</title>
  <style>
    *{
      padding: 0;
      margin: 0;
    }
    .container{
      background-color: gray;
      height: 400px;
      position: relative;
    }
    .inner{
      height: 50px;
      width: 50px;
      background-color: skyblue;
      padding: 20px;
      border: 10px solid black;
      position: absolute;
      right: 0px;
      left: 0px;
      top: 0px;
      bottom: 0px;
      margin: auto;
    }

  </style>
</head>
<body>
  <div class="container">
    <div class="inner">你好啊</div>

  </div>
</body>
</html>